﻿package plugin.wajue.handler
{
    import cmd.*;
    import com.core.*;
    import flash.utils.*;
    import pluginfw.nio.*;
    import pluginfw.nio.imsg.*;

    public class WaJueGroupHandler extends Object implements IGroupHandler
    {

        public function WaJueGroupHandler()
        {
            return;
        }// end function

        public function dealSimpleMessage(param1:ISimpleMessage) : void
        {
            return;
        }// end function

        public function dealBufferMessage(param1:IBufferMessage) : void
        {
            var _loc_2:Object = null;
            var _loc_3:Input = null;
            var _loc_4:ByteArray = null;
            switch(param1.getCmd())
            {
                case CMDBossDig._2_ResDigBossStateMessage:
                {
                    _loc_2 = new Object();
                    _loc_3 = new Input(null);
                    _loc_4 = param1.getBody();
                    _loc_4.position = 0;
                    _loc_3.setBytes(_loc_4);
                    _loc_2.bossId = _loc_3.readVarInt(false);
                    _loc_2.state = _loc_3.readByte();
                    ModelProxy.change("wajue", CMDBossDig.CanWaJue, _loc_2);
                    break;
                }
                case CMDBossDig._4_ResDigBossResultMessage:
                {
                    _loc_2 = new Object();
                    _loc_3 = new Input(null);
                    _loc_4 = param1.getBody();
                    _loc_4.position = 0;
                    _loc_3.setBytes(_loc_4);
                    _loc_2.bossId = _loc_3.readVarInt(false);
                    _loc_2.result = _loc_3.readByte();
                    ModelProxy.change("wajue", CMDBossDig.WaJueResult, _loc_2);
                    break;
                }
                case CMDBossDig._6_ResBossInfoMessage:
                {
                    _loc_2 = new Object();
                    _loc_3 = new Input(null);
                    _loc_4 = param1.getBody();
                    _loc_4.position = 0;
                    _loc_3.setBytes(_loc_4);
                    _loc_2.bossId = _loc_3.readVarInt(false);
                    _loc_2.digCount = _loc_3.readVarInt(false);
                    ModelProxy.change("wajue", CMDBossDig.WaJueCount, _loc_2);
                    break;
                }
                default:
                {
                    break;
                }
            }
            return;
        }// end function

        public function dealProxyMessage(param1:IProxyMessage) : void
        {
            return;
        }// end function

    }
}
